package p;

import static org.junit.Assert.assertTrue;

import java.util.ArrayList;

import model.C;
import model.NoBracesTerm;
import model.Term;
import model.Value;
import model.VarNameFactory;
import model.VarValueList;

import org.junit.Before;
import org.junit.Test;

public class BasicFunctions {

	double xxx=1.2;
	
	@Before
	public void setUp() throws Exception {

	}

	@Test
	public final void testTermClass() {
		Term x;
		
		VarNameFactory.resetId();
		x = new Term("(x+y^2)^vbz+(z*c)", "Bla bla", "ThemeA");
		System.out.println(x.calcLog);
		
//		VarNameFactory.resetId();
//		x = new Term("((x)^(y+z)*z+c)", "Bla bla", "ThemeA");
//		System.out.println(x.fastCalcLog);
	}

	@Test
	public final void varValueListTest() {
		ArrayList<Value> valueList = new ArrayList<Value>();
		valueList.add(new Value("7"));
		valueList.add(new Value("99"));
		String x="x+y";
		VarValueList vvl = new VarValueList(x, valueList);
		System.out.println(vvl);
		assertTrue(vvl.toString().equals("{y=99.0, x=7.0}")); //todo no good test!! hashmap has no order
	}
	
	@Test
	public final void newNoBrachesTermTest() {
		VarNameFactory.resetId();
		NoBracesTerm x;		
		x = new NoBracesTerm("abc", "x+y*2^t^e+9");
		System.out.println(x);
	}
	
	@Test
	public final void testVoid() {
		
		int x,y,z;
		
		y= 2;
		z = 4;
		x = C.calc("x", "y^z", y, z);
		System.out.println(x);
		
//		VarNameFactory.resetId();
//		y= 2;
//		z = 4;
//		x = C.calc("x2=(y+z)*z", y, z);
//		System.out.println(x);
	}

}
